---@class Table_GlobalDataItem
local Table_GlobalDataItem = BaseClass("Table_GlobalDataItem", IDataItem)

function Table_GlobalDataItem:__ctor()
	---@type number @唯一ID
	self.Id = 0
	---@type number @参数Int
	self.IntParam = 0
	---@type boolean @参数Boolean
	self.BooleanParam = false
	---@type string @参数String
	self.StringParam = ""
end

function Table_GlobalDataItem:Load(reader)
	self.temp = reader:ReadShortString()
	self.Id = tonumber(self.temp)
	self.temp = reader:ReadShortString()
	self.IntParam = tonumber(self.temp)
	self.BooleanParam = reader:ReadBool()
	self.StringParam = reader:ReadString()
end

---@class Table_GlobalDataMgr : IDataMgr
local this = BaseClass("Table_GlobalDataMgr", IDataMgr)

function this:FileName()
	return "Txt/GlobalData.txt"
end

---@return Table_GlobalDataItem
function this:GetItemByKey(key)
	return self.super.GetItemByKey(self, key)
end

---@return Table_GlobalDataItem
function this:GetItemByIdx(idx)
	return self.super.GetItemByIdx(self, idx)
end

function this:Load(reader)
	local item = Table_GlobalDataItem()
	item:Load(reader)
	self.mItemDic[item.Id] = self.mDataCount
	table.insert(self.mItemList, item)
end

---@type Table_GlobalDataMgr
Table_GlobalDataMgr = this()